package com.lazydong.apiforward.server.component;

import com.lazydong.apiforward.gateway.component.GatewayDynamicRoute;
import com.lazydong.apiforward.gateway.component.GatewayDynamicRouteComponent;
import com.lazydong.apiforward.gateway.model.RouteDefinitionInfo;
import org.springframework.stereotype.Component;

/**
 * 动态路由组件
 */
@Component
public class DynamicRouteComponent implements GatewayDynamicRoute {
    private GatewayDynamicRouteComponent gatewayDynamicRouteComponent;

    @Override
    public void setDynamicRouteComponent(GatewayDynamicRouteComponent gatewayDynamicRouteComponent) {
        this.gatewayDynamicRouteComponent = gatewayDynamicRouteComponent;
    }

    public void routeChangeEvent(RouteDefinitionInfo routeDefinitionInfo) {
        gatewayDynamicRouteComponent.routeChangeEvent(routeDefinitionInfo);
    }
}
